package com.study.config;

import com.study.model.Person;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyConfig {
    @Value("${spring.profiles.active}")
    private String active;
    @Value("${valueChinese}")
    String valueChinese;

    //相当于 spring 旧知识中的 <bean>,注意:若不指定@Bean(名字),容器中对象名同方法名
    @Bean
    public Person person1() {
        System.out.println("myconfig中"+valueChinese);
        return new Person();
    }
}
